package com.xian.d4_polymorphic_test;

/**
 * 实现类(子类)
 */
public class KeyBoard implements USB{
    private String name;

    public KeyBoard(String name) {
        this.name = name;
    }

    @Override
    public void connect() {
        System.out.println(name+"成功接入了设备！！！");
    }

    @Override
    public void unconnect() {
        System.out.println(name+"成功弹出了设备！！！");
    }

    /**
     * 独有功能
     */
    public void KeyDown(){
        System.out.println(name+"写下了老铁666！！！");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
